import axios from '../http/htttp.js'
import qs from 'qs'
// 角色列表
export function Rolelist (zhi) {
  return axios({
    method: 'get',
    params: {
      _gp: 'admin.role',
      _mt: 'list',
      ...zhi
    }
  })
}
// 添加
export function addto (formsd) {
  return axios({
    method: 'get',
    params: {
      _gp: 'admin.role',
      _mt: 'create',
      role: formsd
    }
  })
}
// 编辑
export function edit (formsd) {
  return axios({
    method: 'post',
    params: {
      _gp: 'admin.role',
      _mt: 'update',
      role: formsd
    }
  })
}
// 删除
export function deletes (eidd) {
  return axios({
    method: 'post',
    params: {
      _gp: 'admin.role',
      _mt: 'delete',
      roleId: eidd
    }
  })
}
// 权限列表
export function Permissionlist (dxian) {
  return axios({
    method: 'get',
    params: {
      _gp: 'admin.role',
      _mt: 'permissionList',
      roleId: dxian
    }
  })
}
// 修改角色权限
export function Modifyrolepermissions (timestamps) {
  return axios({
    method: 'post',
    data: qs.stringify({
      _gp: 'admin.role',
      _mt: 'permissionSet',
      roleSetPermissionDTO: JSON.stringify(timestamps)
    })
  })
}
